Produced by Araxis Merge on 2023-07-12 04:43:09 +0000. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | 2023-07-12 04:43:09 +0000 | ||
| 2 | Porto v4.0.6/Theme Files/Porto Theme/app/design/frontend/Smartwave/porto/Smartwave_Filterproducts/templates/widget | grid.phtml | 2023-07-12 04:05:32 +0000 |
| Description | Between Files 1 and 2 | |
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 0 | 0 |
| Changed | 0 | 0 |
| Inserted | 1 | 456 |
| Removed | 0 | 0 |
| Whitespace | Consecutive whitespace is treated as a single space |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
| Active line-pairing rules |
No regular expressions were active.
| 1 | <?php | |||||
| 2 | /** | |||||
| 3 | * Copyright © 2015 Magento. All rights reserved. | |||||
| 4 | * See COPYING.txt for license details. | |||||
| 5 | */ | |||||
| 6 | use Magento\Framework\App\Action\Action; | |||||
| 7 | ||||||
| 8 | // @codingStandardsIgnoreFile | |||||
| 9 | ?> | |||||
| 10 | <?php | |||||
| 11 | /** | |||||
| 12 | * Product list template | |||||
| 13 | * | |||||
| 14 | * @var $block \Smartwave\Filterproducts\Block\ | |||||
| 15 | */ | |||||
| 16 | ?> | |||||
| 17 | <?php | |||||
| 18 | if ($exist = ($block->getProductCollection() && $block->getProductCollection()->getSize())) { | |||||
| 19 | $_productCollection = $block->getProductCollection()->getItems(); | |||||
| 20 | $_helper = $this->helper('Magento\Catalog\Helper\Output'); | |||||
| 21 | $_imagehelper = $this->helper('Magento\Catalog\Helper\Image'); | |||||
| 22 | $_portohelper = $this->helper('Smartwave\Porto\Helper\Data'); | |||||
| 23 | $_category_config = $_portohelper->getConfig('porto_settings/category'); | |||||
| 24 | $_category_grid_config = $_portohelper->getConfig('porto_settings/category_grid'); | |||||
| 25 | $_product_label_config = $this->helper('Smartwave\Porto\Helper\Data')->getConfig('porto_settings/product_label'); | |||||
| 26 | // Daily deal Helper | |||||
| 27 | $_dailydealhelper =$this->helper('Smartwave\Dailydeals\Helper\Data'); | |||||
| 28 | ||||||
| 29 | $_lazyload = $this->getData("lazyload"); | |||||
| 30 | if($_lazyload == null) { | |||||
| 31 | $_lazyload = $this->helper('Smartwave\Porto\Helper\Data')->getConfig('porto_settings/optimization/lazyload'); | |||||
| 32 | } | |||||
| 33 | ||||||
| 34 | $aspect_ratio = $this->getData("aspect_ratio"); | |||||
| 35 | if($aspect_ratio == null) { | |||||
| 36 | $aspect_ratio = $_category_config['aspect_ratio']; | |||||
| 37 | } | |||||
| 38 | $image_width = $this->getData("image_width"); | |||||
| 39 | if(!$image_width) { | |||||
| 40 | $image_width = ($_category_config['ratio_width'])?$_category_config['ratio_width']:300; | |||||
| 41 | } | |||||
| 42 | $image_height = $this->getData("image_height"); | |||||
| 43 | if($aspect_ratio) | |||||
| 44 | $image_height = $image_width; | |||||
| 45 | if(!$image_height) { | |||||
| 46 | $image_height = ($_category_config['ratio_height'])?$_category_config['ratio_height']:300; | |||||
| 47 | } | |||||
| 48 | $column_count = $this->getData("column_count"); | |||||
| 49 | if($column_count == null) { | |||||
| 50 | $column_count = 4; | |||||
| 51 | } | |||||
| 52 | $product_type = $this->getData("product_type"); | |||||
| 53 | if($product_type == null) { | |||||
| 54 | $product_type = $_category_grid_config['product_type']; | |||||
| 55 | } | |||||
| 56 | if($product_type == null) { | |||||
| 57 | $product_type = 1; | |||||
| 58 | } | |||||
| 59 | } | |||||
| 60 | ?> | |||||
| 61 | <?php if (!$exist): ?> | |||||
| 62 | <div class="message info empty"><div><?php echo __('We can\'t find products matching the selection.') ?></div></div> | |||||
| 63 | <?php else: ?> | |||||
| 64 | <?php | |||||
| 65 | $viewMode = 'grid'; | |||||
| 66 | $image = 'category_page_grid'; | |||||
| 67 | $hover_image = 'category_page_grid-hover'; | |||||
| 68 | $showDescription = false; | |||||
| 69 | $templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW; | |||||
| 70 | ?> | |||||
| 71 | <div class="products wrapper <?php echo $viewMode; ?> columns<?php echo $column_count; ?> products-<?php echo $viewMode; ?> <?php if($product_type == 2): ?>no-padding divider-line<?php endif; ?> <?php if($product_type == 5 || $product_type == 6 || $product_type == 7 || $product_type == 8): ?>no-padding<?php endif; ?> <?php if($product_type == 6): ?>divider-line<?php endif; ?>"> | |||||
| 72 | <?php $iterator = 1; ?> | |||||
| 73 | <ol class="filterproducts products list items product-items"> | |||||
| 74 | <?php /** @var $_product \Magento\Catalog\Model\Product */ ?> | |||||
| 75 | <?php foreach ($_productCollection as $_product): ?> | |||||
| 76 | <?php echo($iterator++ == 1) ? '<li class="item product product-item">' : '</li><li class="item product product-item">' ?> | |||||
| 77 | <div class="product-item-info type<?php echo $product_type; ?>" data-container="product-grid"> | |||||
| 78 | <?php // Product Image ?> | |||||
| 79 | <div class="product photo product-item-photo"> | |||||
| 80 | <a href="<?php echo $_product->getProductUrl() ?>" tabindex="-1"> | |||||
| 81 | <?php | |||||
| 82 | if($aspect_ratio) | |||||
| 83 | $productImage = $_imagehelper->init($_product, $image)->constrainOnly(FALSE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->resize($image_width); | |||||
| 84 | else | |||||
| 85 | $productImage = $_imagehelper->init($_product, $image)->resize($image_width, $image_height); | |||||
| 86 | $productImageUrl = $productImage->getUrl(); | |||||
| 87 | ?> | |||||
| 88 | <img class="product-image-photo default_image <?php if(!$_lazyload): ?>porto-lazyload<?php endif;?>" <?php if(!$_lazyload): ?>data-<?php endif; ?>src="<?php echo $productImageUrl; ?>" width="<?php echo $image_width; ?>" height="<?php echo $image_height; ?>" alt="<?php //echo $productImage->getLabel();?>"/> | |||||
| 89 | <?php if($_category_config['alternative_image']): ?> | |||||
| 90 | <?php | |||||
| 91 | if($aspect_ratio) | |||||
| 92 | $productHoverImage = $_imagehelper->init($_product, $hover_image)->constrainOnly(FALSE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->resize($image_width); | |||||
| 93 | else | |||||
| 94 | $productHoverImage = $_imagehelper->init($_product, $hover_image)->resize($image_width, $image_height); | |||||
| 95 | $productHoverImageUrl = $productHoverImage->getUrl(); | |||||
| 96 | ?> | |||||
| 97 | <?php if($productImageUrl != str_replace("/thumbnail/","/small_image/",$productHoverImageUrl)): ?> | |||||
| 98 | <img class="product-image-photo hover_image" src="<?php echo $productHoverImageUrl; ?>" alt="<?php //echo $productHoverImage->getLabel();?>"/> | |||||
| 99 | <?php endif; ?> | |||||
| 100 | <?php endif; ?> | |||||
| 101 | </a> | |||||
| 102 | <?php | |||||
| 103 | $product_label = ""; | |||||
| 104 | if($_product_label_config['sale_label']) { | |||||
| 105 | if ($percentage = $_portohelper->getPercentage($_product)) { | |||||
| 106 | if($_product_label_config['sale_label_percent']) { | |||||
| 107 | $product_label .= '<div class="product-label sale-label">'.$percentage.'%'.'</div>'; | |||||
| 108 | } else { | |||||
| 109 | $product_label .= '<div class="product-label sale-label">'.$_product_label_config['sale_label_text'].'</div>'; | |||||
| 110 | } | |||||
| 111 | } | |||||
| 112 | } | |||||
| 113 | if($_product_label_config['new_label']) { | |||||
| 114 | $now = date("Y-m-d"); | |||||
| 115 | $newsFrom= substr($_product->getData('news_from_date')?$_product->getData('news_from_date'):'',0,10); | |||||
| 116 | $newsTo= substr($_product->getData('news_to_date')?$_product->getData('news_to_date'):'',0,10); | |||||
| 117 | ||||||
| 118 | if ($newsTo != '' || $newsFrom != ''){ | |||||
| 119 | if (($newsTo != '' && $newsFrom != '' && $now>=$newsFrom && $now<=$newsTo) || ($newsTo == '' && $now >=$newsFrom) || ($newsFrom == '' && $now<=$newsTo)) { | |||||
| 120 | $product_label .= '<div class="product-label new-label">'.$_product_label_config['new_label_text'].'</div>'; | |||||
| 121 | } | |||||
| 122 | } | |||||
| 123 | } | |||||
| 124 | if($product_label) | |||||
| 125 | echo '<div class="product-labels">'.$product_label.'</div>'; | |||||
| 126 | ?> | |||||
| 127 | <?php if($product_type == 3 || $product_type == 5 || $product_type == 6 || $product_type == 7 || $product_type == 8 || $product_type == 9 || $product_type == 11): ?> | |||||
| 128 | <div class="product-item-inner"> | |||||
| 129 | <div class="product actions product-item-actions"> | |||||
| 130 | <div class="actions-primary"> | |||||
| 131 | <?php if ($_product->isSaleable()): ?> | |||||
| 132 | <?php $postParams = $block->getAddToCartPostParams($_product); ?> | |||||
| 133 | <form data-role="tocart-form" action="<?php echo $postParams['action']; ?>" method="post"> | |||||
| 134 | <input type="hidden" name="product" value="<?php echo $postParams['data']['product']; ?>"> | |||||
| 135 | <input type="hidden" name="<?php echo Action::PARAM_NAME_URL_ENCODED; ?>" value="<?php echo $postParams['data'][Action::PARAM_NAME_URL_ENCODED]; ?>"> | |||||
| 136 | <?php echo $block->getBlockHtml('formkey')?> | |||||
| 137 | <button type="submit" | |||||
| 138 | title="<?php echo $block->escapeHtml(__('Add to Cart')); ?>" | |||||
| 139 | class="action tocart primary"> | |||||
| 140 | <span><?php echo __('Add to Cart') ?></span> | |||||
| 141 | </button> | |||||
| 142 | </form> | |||||
| 143 | <?php else: ?> | |||||
| 144 | <?php if ($_product->getIsSalable()): ?> | |||||
| 145 | <div class="stock available"><span><?php echo __('In stock') ?></span></div> | |||||
| 146 | <?php else: ?> | |||||
| 147 | <div class="stock unavailable"><span><?php echo __('Out of stock') ?></span></div> | |||||
| 148 | <?php endif; ?> | |||||
| 149 | <?php endif; ?> | |||||
| 150 | </div> | |||||
| 151 | <?php if ($block->getMode() == 'grid'): ?> | |||||
| 152 | <?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow()): ?> | |||||
| 153 | <a href="#" | |||||
| 154 | class="action towishlist actions-secondary" | |||||
| 155 | title="<?php echo $block->escapeHtml(__('Add to Wish List')); ?>" | |||||
| 156 | aria-label="<?php echo $block->escapeHtml(__('Add to Wish List')); ?>" | |||||
| 157 | data-post='<?php echo $block->getAddToWishlistParams($_product); ?>' | |||||
| 158 | data-action="add-to-wishlist" | |||||
| 159 | role="button"> | |||||
| 160 | <span><?php echo __('Add to Wish List') ?></span> | |||||
| 161 | </a> | |||||
| 162 | <?php endif; ?> | |||||
| 163 | <?php endif; ?> | |||||
| 164 | <?php if($_category_config['addtocompare']): ?> | |||||
| 165 | <?php | |||||
| 166 | $compareHelper = $this->helper('Magento\Catalog\Helper\Product\Compare'); | |||||
| 167 | ?> | |||||
| 168 | <a href="#" | |||||
| 169 | class="action tocompare actions-secondary" | |||||
| 170 | title="<?php echo $block->escapeHtml(__('Add to Compare')); ?>" | |||||
| 171 | aria-label="<?php echo $block->escapeHtml(__('Add to Compare')); ?>" | |||||
| 172 | data-post='<?php echo $compareHelper->getPostDataParams($_product); ?>' | |||||
| 173 | role="button"> | |||||
| 174 | <span><?php echo __('Add to Compare') ?></span> | |||||
| 175 | </a> | |||||
| 176 | <?php endif; ?> | |||||
| 177 | </div> | |||||
| 178 | </div> | |||||
| 179 | <?php endif; ?> | |||||
| 180 | <!-- Dailydeal Product data --> | |||||
| 181 | <?php if($_dailydealhelper->isDealProduct($_product->getId())) : ?> | |||||
| 182 | <?php $unique_id = $this->getData("name")."_".rtrim(base64_encode(md5(microtime())),"="); ?> | |||||
| 183 | <input type="hidden" id="todate_<?php echo $unique_id; ?>" value="<?php echo $_dailydealhelper->getDailydealToDate($_product->getSku()); ?>" > | |||||
| 184 | <input type="hidden" id="fromdate_<?php echo $unique_id; ?>" value="<?php echo $_dailydealhelper->getDailydealFromDate($_product->getSku()); ?>"> | |||||
| 185 | <div class="sw-dailydeal-wrapper" style="display:none;" data-unique-id="<?php echo $unique_id; ?>"> | |||||
| 186 | <div class="sw-dailydeal"> | |||||
| 187 | <p id="expired_<?php echo $unique_id; ?>"></p> | |||||
| 188 | <div class="countdowncontainer countdowncontainer_<?php echo $unique_id; ?>" style="display:none;"> | |||||
| 189 | <span class="dailydeal-label"> | |||||
| 190 | <?php echo __('Ends In:'); ?> | |||||
| 191 | </span> | |||||
| 192 | <span class="number-wrapper"> | |||||
| 193 | <div class="line"></div> | |||||
| 194 | <span class="number day"><p id="countdown_days_<?php echo $unique_id; ?>">00</p></span> | |||||
| 195 | <div class="caption"><?php echo __('Day(s), '); ?></div> | |||||
| 196 | </span> | |||||
| 197 | ||||||
| 198 | <span class="number-wrapper"> | |||||
| 199 | <div class="line"></div> | |||||
| 200 | <span class="number hour"><p id="countdown_hours_<?php echo $unique_id; ?>">00</p></span> | |||||
| 201 | <div class="caption">:</div> | |||||
| 202 | </span> | |||||
| 203 | ||||||
| 204 | <span class="number-wrapper"> | |||||
| 205 | <div class="line"></div> | |||||
| 206 | <span class="number min"><p id="countdown_minutes_<?php echo $unique_id; ?>">00</p></span> | |||||
| 207 | <div class="caption">:</div> | |||||
| 208 | </span> | |||||
| 209 | ||||||
| 210 | <span class="number-wrapper"> | |||||
| 211 | <div class="line"></div> | |||||
| 212 | <span class="number sec"><p id="countdown_seconds_<?php echo $unique_id; ?>">00</p></span> | |||||
| 213 | <div class="caption"></div> | |||||
| 214 | </span> | |||||
| 215 | </div> | |||||
| 216 | </div> | |||||
| 217 | </div> | |||||
| 218 | <?php endif; ?> | |||||
| 219 | <!-- Dailydeal Product End --> | |||||
| 220 | </div> | |||||
| 221 | <div class="product details product-item-details"> | |||||
| 222 | <?php | |||||
| 223 | $_productNameStripped = $block->stripTags($_product->getName(), null, true); | |||||
| 224 | ?> | |||||
| 225 | <strong class="product name product-item-name"> | |||||
| 226 | <a class="product-item-link" | |||||
| 227 | href="<?php echo $_product->getProductUrl() ?>"> | |||||
| 228 | <?php echo $_helper->productAttribute($_product, $_product->getName(), 'name'); ?> | |||||
| 229 | </a> | |||||
| 230 | </strong> | |||||
| 231 | <?php //$_category_config['rating_star'] = ""; //disabled at the moment ?> | |||||
| 232 | <?php if($_category_config['rating_star']): ?> | |||||
| 233 | <?php | |||||
| 234 | $review_html = $block->getReviewsSummaryHtml($_product, $templateType); | |||||
| 235 | ?> | |||||
| 236 | <?php if($review_html): ?> | |||||
| 237 | <?php echo $block->getReviewsSummaryHtml($_product, $templateType); ?> | |||||
| 238 | <?php else: ?> | |||||
| 239 | <div class="product-reviews-summary short"> | |||||
| 240 | <div class="rating-summary"> | |||||
| 241 | <span class="label"><span>Rating:</span></span> | |||||
| 242 | <div class="rating-result" title="0%"> | |||||
| 243 | <span style="width:0"><span>0%</span></span> | |||||
| 244 | </div> | |||||
| 245 | </div> | |||||
| 246 | </div> | |||||
| 247 | <?php endif; ?> | |||||
| 248 | <?php endif; ?> | |||||
| 249 | ||||||
| 250 | <?php if ($showDescription):?> | |||||
| 251 | <div class="product description product-item-description"> | |||||
| 252 | <?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?> | |||||
| 253 | <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped ?>" | |||||
| 254 | class="action more"><?php echo __('Learn More') ?></a> | |||||
| 255 | </div> | |||||
| 256 | <?php endif; ?> | |||||
| 257 | <?php if($_category_config['product_price']): ?> | |||||
| 258 | <?php echo $block->getProductPrice($_product) ?> | |||||
| 259 | <?php endif; ?> | |||||
| 260 | <?php echo $block->getProductDetailsHtml($_product); ?> | |||||
| 261 | ||||||
| 262 | <?php if($product_type != 3 && $product_type != 5 && $product_type != 6 && $product_type != 7 && $product_type != 8 && $product_type != 9 && $product_type != 11 && $product_type != 12): ?> | |||||
| 263 | <div class="product-item-inner"> | |||||
| 264 | <div class="product actions product-item-actions"> | |||||
| 265 | <?php if ($block->getMode() == 'grid'): ?> | |||||
| 266 | <?php if($_category_config['addtowishlist'] && $product_type != 4): ?> | |||||
| 267 | <?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow()): ?> | |||||
| 268 | <a href="#" | |||||
| 269 | class="action towishlist actions-secondary" | |||||
| 270 | title="<?php echo $block->escapeHtml(__('Add to Wish List')); ?>" | |||||
| 271 | aria-label="<?php echo $block->escapeHtml(__('Add to Wish List')); ?>" | |||||
| 272 | data-post='<?php echo $block->getAddToWishlistParams($_product); ?>' | |||||
| 273 | data-action="add-to-wishlist" | |||||
| 274 | role="button"> | |||||
| 275 | <span><?php echo __('Add to Wish List') ?></span> | |||||
| 276 | </a> | |||||
| 277 | <?php endif; ?> | |||||
| 278 | <?php endif; ?> | |||||
| 279 | <?php endif; ?> | |||||
| 280 | <div class="actions-primary"> | |||||
| 281 | <?php if ($_product->isSaleable()): ?> | |||||
| 282 | <?php $postParams = $block->getAddToCartPostParams($_product); ?> | |||||
| 283 | <form data-role="tocart-form" action="<?php echo $postParams['action']; ?>" method="post"> | |||||
| 284 | <input type="hidden" name="product" value="<?php echo $postParams['data']['product']; ?>"> | |||||
| 285 | <input type="hidden" name="<?php echo Action::PARAM_NAME_URL_ENCODED; ?>" value="<?php echo $postParams['data'][Action::PARAM_NAME_URL_ENCODED]; ?>"> | |||||
| 286 | <?php if($product_type == 10):?> | |||||
| 287 | <div class="qty-box"> | |||||
| 288 | <a href="javascript:void(0)" class="qtyminus"><i class="porto-icon-minus"></i></a> | |||||
| 289 | <input type="text" name="qty" id="qty" maxlength="12" value="<?php echo ($this->getMinimalQty($_product)?$this->getMinimalQty($_product):1) ?>" title="<?php /* @escapeNotVerified */ echo __('Qty') ?>" class="input-text qty" data-validate="<?php echo $block->escapeHtml(json_encode($block->getQuantityValidators())) ?>"/> | |||||
| 290 | <a href="javascript:void(0)" class="qtyplus"><i class="porto-icon-plus"></i></a> | |||||
| 291 | </div> | |||||
| 292 | <?php endif;?> | |||||
| 293 | <?php echo $block->getBlockHtml('formkey')?> | |||||
| 294 | <button type="submit" | |||||
| 295 | title="<?php echo $block->escapeHtml(__('Add to Cart')); ?>" | |||||
| 296 | class="action tocart primary"> | |||||
| 297 | <span><?php echo __('Add to Cart') ?></span> | |||||
| 298 | </button> | |||||
| 299 | </form> | |||||
| 300 | <?php else: ?> | |||||
| 301 | <?php if ($_product->getIsSalable()): ?> | |||||
| 302 | <div class="stock available"><span><?php echo __('In stock') ?></span></div> | |||||
| 303 | <?php else: ?> | |||||
| 304 | <div class="stock unavailable"><span><?php echo __('Out of stock') ?></span></div> | |||||
| 305 | <?php endif; ?> | |||||
| 306 | <?php endif; ?> | |||||
| 307 | </div> | |||||
| 308 | <?php if ($block->getMode() == 'grid'): ?> | |||||
| 309 | <?php if($_category_config['addtowishlist'] && $product_type == 4): ?> | |||||
| 310 | <?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow()): ?> | |||||
| 311 | <a href="#" | |||||
| 312 | class="action towishlist actions-secondary" | |||||
| 313 | title="<?php echo $block->escapeHtml(__('Add to Wish List')); ?>" | |||||
| 314 | aria-label="<?php echo $block->escapeHtml(__('Add to Wish List')); ?>" | |||||
| 315 | data-post='<?php echo $block->getAddToWishlistParams($_product); ?>' | |||||
| 316 | data-action="add-to-wishlist" | |||||
| 317 | role="button"> | |||||
| 318 | <span><?php echo __('Add to Wish List') ?></span> | |||||
| 319 | </a> | |||||
| 320 | <?php endif; ?> | |||||
| 321 | <?php endif; ?> | |||||
| 322 | <?php endif; ?> | |||||
| 323 | <?php if($_category_config['addtocompare']): ?> | |||||
| 324 | <?php | |||||
| 325 | $compareHelper = $this->helper('Magento\Catalog\Helper\Product\Compare'); | |||||
| 326 | ?> | |||||
| 327 | <a href="#" | |||||
| 328 | class="action tocompare actions-secondary" | |||||
| 329 | title="<?php echo $block->escapeHtml(__('Add to Compare')); ?>" | |||||
| 330 | aria-label="<?php echo $block->escapeHtml(__('Add to Compare')); ?>" | |||||
| 331 | data-post='<?php echo $compareHelper->getPostDataParams($_product); ?>' | |||||
| 332 | role="button"> | |||||
| 333 | <span><?php echo __('Add to Compare') ?></span> | |||||
| 334 | </a> | |||||
| 335 | <?php endif; ?> | |||||
| 336 | </div> | |||||
| 337 | </div> | |||||
| 338 | <?php endif; ?> | |||||
| 339 | </div> | |||||
| 340 | </div> | |||||
| 341 | <?php echo($iterator == count($_productCollection)+1) ? '</li>' : '' ?> | |||||
| 342 | <?php endforeach; ?> | |||||
| 343 | </ol> | |||||
| 344 | </div> | |||||
| 345 | <?= $block->getPagerHtml() ?> | |||||
| 346 | <?php if (!$_dailydealhelper->isLoadedTimer()): ?> | |||||
| 347 | <script type="text/javascript"> | |||||
| 348 | require([ | |||||
| 349 | 'jquery' | |||||
| 350 | ], function ($) { | |||||
| 351 | // Timer for LEFT time for Dailydeal product | |||||
| 352 | var _second = 1000; | |||||
| 353 | var _minute = _second * 60; | |||||
| 354 | var _hour = _minute * 60; | |||||
| 355 | var _day = _hour * 24; | |||||
| 356 | var timer; | |||||
| 357 | ||||||
| 358 | //Set date as magentodatetime | |||||
| 359 | var date = new Date('<?php echo $_dailydealhelper->getcurrentDate() ?>'); | |||||
| 360 | var l_date = new Date(); | |||||
| 361 | var offset_date = l_date - date; | |||||
| 362 | ||||||
| 363 | function showRemaining() | |||||
| 364 | { | |||||
| 365 | $(".sw-dailydeal-wrapper").each(function(){ | |||||
| 366 | var unique_id = $(this).attr("data-unique-id"); | |||||
| 367 | // get Value of dailydeal product | |||||
| 368 | var cid='countdown_'+unique_id; | |||||
| 369 | var daysid='countdown_days_'+unique_id; | |||||
| 370 | var hoursid='countdown_hours_'+unique_id; | |||||
| 371 | var minutesid='countdown_minutes_'+unique_id; | |||||
| 372 | var secondsid='countdown_seconds_'+unique_id; | |||||
| 373 | ||||||
| 374 | var startdateid='fromdate_'+unique_id; | |||||
| 375 | var id='todate_'+unique_id; | |||||
| 376 | ||||||
| 377 | var enddate = new Date($('#'+id).val()); | |||||
| 378 | var dealstartdate=new Date($('#'+startdateid).val()); | |||||
| 379 | ||||||
| 380 | var currentdate=new Date(); | |||||
| 381 | ||||||
| 382 | //Get Difference between Two dates | |||||
| 383 | var distance = enddate - (currentdate - offset_date); | |||||
| 384 | ||||||
| 385 | $('.sw-dailydeal-wrapper').show(); | |||||
| 386 | ||||||
| 387 | if (distance < 0) { | |||||
| 388 | // clearInterval(timer); | |||||
| 389 | $('#expired_'+unique_id).html("<span style='font-size:25px; color:#000;'>EXPIRED!<span>"); | |||||
| 390 | ||||||
| 391 | } else if(dealstartdate > currentdate) { | |||||
| 392 | $('.countdowncontainer_'+unique_id).hide(); | |||||
| 393 | var msg="<span style='font-size:15px; color:#000;'> Coming Soon..<br>Deal Start at:<br>"+$('#'+startdateid).val()+"<span>"; | |||||
| 394 | $('#expired_'+unique_id).html(msg); | |||||
| 395 | } else { | |||||
| 396 | var days = Math.floor(distance / _day); | |||||
| 397 | var hours = Math.floor((distance % _day) / _hour); | |||||
| 398 | var minutes = Math.floor((distance % _hour) / _minute); | |||||
| 399 | var seconds = Math.floor((distance % _minute) / _second); | |||||
| 400 | ||||||
| 401 | if(hours < 10) | |||||
| 402 | hours = "0" + hours; | |||||
| 403 | if(minutes < 10) | |||||
| 404 | minutes = "0" + minutes; | |||||
| 405 | if(seconds < 10) | |||||
| 406 | seconds = "0" + seconds; | |||||
| 407 | $('.countdowncontainer_'+unique_id).show(); | |||||
| 408 | $('#'+daysid).html(days); | |||||
| 409 | $('#'+hoursid).html(hours); | |||||
| 410 | $('#'+minutesid).html(minutes); | |||||
| 411 | $('#'+secondsid).html(seconds); | |||||
| 412 | } | |||||
| 413 | }); | |||||
| 414 | } | |||||
| 415 | ||||||
| 416 | // Set Interval | |||||
| 417 | timer = setInterval(function() | |||||
| 418 | { | |||||
| 419 | showRemaining(); | |||||
| 420 | }, 1000); | |||||
| 421 | }); | |||||
| 422 | </script> | |||||
| 423 | <?php $_dailydealhelper->setLoadedTimer(); ?> | |||||
| 424 | <?php endif; ?> | |||||
| 425 | <script type="text/javascript"> | |||||
| 426 | require([ | |||||
| 427 | 'jquery', | |||||
| 428 | 'Smartwave_Filterproducts/js/lazyload/jquery.lazyload' | |||||
| 429 | ], function ($) { | |||||
| 430 | $("img.porto-lazyload:not(.porto-lazyload-loaded)").lazyload({effect:"fadeIn", effect_speed: 400 }); | |||||
| 431 | $('.products.grid .product-items.filterproducts li.product-item:nth-child(2n)').addClass('nth-child-2n'); | |||||
| 432 | $('.products.grid .product-items.filterproducts li.product-item:nth-child(2n+1)').addClass('nth-child-2np1'); | |||||
| 433 | $('.products.grid .product-items.filterproducts li.product-item:nth-child(3n)').addClass('nth-child-3n'); | |||||
| 434 | $('.products.grid .product-items.filterproducts li.product-item:nth-child(3n+1)').addClass('nth-child-3np1'); | |||||
| 435 | $('.products.grid .product-items.filterproducts li.product-item:nth-child(4n)').addClass('nth-child-4n'); | |||||
| 436 | $('.products.grid .product-items.filterproducts li.product-item:nth-child(4n+1)').addClass('nth-child-4np1'); | |||||
| 437 | $('.products.grid .product-items.filterproducts li.product-item:nth-child(5n)').addClass('nth-child-5n'); | |||||
| 438 | $('.products.grid .product-items.filterproducts li.product-item:nth-child(5n+1)').addClass('nth-child-5np1'); | |||||
| 439 | $('.products.grid .product-items.filterproducts li.product-item:nth-child(6n)').addClass('nth-child-6n'); | |||||
| 440 | $('.products.grid .product-items.filterproducts li.product-item:nth-child(6n+1)').addClass('nth-child-6np1'); | |||||
| 441 | $('.products.grid .product-items.filterproducts li.product-item:nth-child(7n)').addClass('nth-child-7n'); | |||||
| 442 | $('.products.grid .product-items.filterproducts li.product-item:nth-child(7n+1)').addClass('nth-child-7np1'); | |||||
| 443 | $('.products.grid .product-items.filterproducts li.product-item:nth-child(8n)').addClass('nth-child-8n'); | |||||
| 444 | $('.products.grid .product-items.filterproducts li.product-item:nth-child(8n+1)').addClass('nth-child-8np1'); | |||||
| 445 | }); | |||||
| 446 | </script> | |||||
| 447 | <?php if (!$block->isRedirectToCartEnabled()) : ?> | |||||
| 448 | <script type="text/x-magento-init"> | |||||
| 449 | { | |||||
| 450 | "[data-role=tocart-form], .form.map.checkout": { | |||||
| 451 | "catalogAddToCart": {} | |||||
| 452 | } | |||||
| 453 | } | |||||
| 454 | </script> | |||||
| 455 | <?php endif; ?> | |||||
| 456 | <?php endif; ?> |
Araxis Merge (but not the data content of this report) is Copyright © 1993–2019 Araxis Ltd (www.araxis.com). All rights reserved.